function poBtnOnClick() {
	var tabletools = TableTools.fnGetInstance('table');
	var list = new Array();
	list = tabletools.fnGetSelected();

	if (list.length <= 0) {
		alert("A row has to be selected!");
		return false;
	}

	var selectedValue = '';
	var selectedStore = '';
	for ( var i = 0; i < tabletools.fnGetSelected().length; i++) {
		var value = tabletools.fnGetSelected()[i].getElementsByTagName("td")[0].innerHTML;
		selectedValue += value + ';';
		if (i > 0) {
			if (selectedStore != tabletools.fnGetSelected()[i]
					.getElementsByTagName("td")[2].innerHTML) {
				alert("Items sent to stock has to be in one store");
				clearFields();
				return false;

			}
		}
		selectedStore = tabletools.fnGetSelected()[i]
				.getElementsByTagName("td")[2].innerHTML;

	}
	// alert(selectedValue + " " + selectedStore);
	$("[id='stocks_form:selected_value']").val(selectedValue);
	$("[id='stocks_form:selected_store']").val(selectedStore);

	if (selectedValue == '') {
		return false;
	} else {
		return true;
	}
}

function createOnClick() {

}

function clearFields() {
	$("[id='stocks_form:selected_value']").val('');
	$("[id='stocks_form:selected_store']").val('');
}


